home *** CD-ROM | disk | FTP | other *** search
/ 3D World 4 (Spanish) / 3DWorld_04.iso / mac / POVRAY-MAC / 68020 sin coprocesador / 68K Non-FPU Application / POV-Ray 3 Templates < prev    next >
Text File  |  1997-01-29  |  51KB  |  1,755 lines

  1. @com.POV-Ray 3 Macintosh Template file
  2. @com.Version: 3.0.1 beta n1
  3. @com. **** NOTE: Look for "FIXME" string for incomplete sections ****
  4. @com.Last Modified:
  5. @com.   [esp] September 27, 1995
  6. @com.   [anr] December 28, 1995
  7. @com.   [esp] March 18, 1996
  8. @com.   [Matt Kruse] April 9, 1996 <mkruse@demian.sau.edu> a few tweaks
  9. @com.   [esp] 961021 fixed irid and additional includes
  10. @com.   [anr] Januari 29, 1997
  11. @com.------------------------------------------------------------
  12. @com.
  13. @com.============================================================
  14. @mt1.Headers
  15. @com.============================================================
  16. @com.
  17. @com.------------------------------
  18. @mt2.Scene File Header
  19. // Persistence of Vision Ray Tracer Scene Description File
  20. // File: .pov
  21. // Vers: 3
  22. // Desc: 
  23. // Date: 
  24. // Auth: 
  25.  
  26. @com.------------------------------
  27. @mt2.Standard includes
  28. // ==== Standard POV-Ray Includes ====
  29. #include "colors.inc"    // Standard Color definitions
  30. #include "textures.inc"    // Standard Texture definitions
  31.  
  32. @com.------------------------------
  33. @mt2.Additional includes
  34. // ==== Additional Includes ====
  35. // Don't have all of the following included at once, it'll cost memory and time
  36. // to parse!
  37. #include "CHARS.INC"    // A complete library of character objects, by Ken Maeno
  38. #include "CONSTS.INC"   // Various constants and alias definitions
  39. #include "FINISH.INC"   // Some basic finishes
  40. #include "GLASS.INC"    // Glass textures
  41. #include "GOLDS.INC"    // Gold textures
  42. #include "METALS.INC"   // Metallic pigments, finishes, and textures
  43. #include "RAD_DEF.INC"  // Some common radiosity settings
  44. #include "SHAPES.INC"   // Standard objects from POV-Ray's earlier days
  45. #include "SHAPES2.INC"  // Useful, but seldom used shapes
  46. #include "SHAPESQ.INC"  // Pre-defined quartic shapes
  47. #include "SKIES.INC"    // Ready defined sky spheres
  48. #include "STONES.INC"   // Binding include-file for STONES1 and STONES2
  49. #include "STONES1.INC"  // Great stone-textures created by Mike Miller
  50. #include "STONES2.INC"  // More, done by Dan Farmer and Paul Novak
  51. #include "WOODMAPS.INC" // Basic wooden colormaps
  52. #include "WOODS.INC"    // Great wooden textures created by Dan Farmer and Paul Novak
  53.  
  54. @com.============================================================
  55. @mt1.Statements
  56. @com.============================================================
  57. @com.
  58. @com.------------------------------
  59. @mt2.background
  60. // Set a color of the background (sky)
  61. background { color red 0.1 green 0.3 blue 0.8 }
  62. @com.------------------------------
  63. @mt2.Typical camera
  64. camera
  65. {
  66.   location  <0.0 , 2.0 ,-5.0>
  67.   look_at   <0.0 , 0.0 , 0.0>
  68. }
  69. @mt2.Camera definition
  70. // set viewer's position in the scene
  71. camera
  72. {
  73. // (camera types)
  74. //  perspective (default) | orthographic | fisheye |
  75. //  ultra_wide_angle | omnimax | panoramic | cylinder 1
  76.   location  <0.0, 1.0, -6.0> // position of camera <X Y Z>
  77.   direction 2.0*z            // which way are we looking <X Y Z> & zoom
  78. //  sky       y                // rarely used
  79.   up        y                // which way is +up <X Y Z>
  80.   right     4/3*x            // which way is +right <X Y Z> and aspect ratio
  81.   look_at   <0.0, 0.0,  0.0> // point center of view at this point <X Y Z>
  82. //  angle FLOAT                // overrides "direction" with specific angle
  83. //  normal { ripples 0.2 }     // perturb the camera lens with a pattern
  84. // (focal blur extras)
  85. //  aperture 0.2               // 0...N (bigger is narrower depth of field)
  86. //  blur_samples 4             // # of rays per pixel
  87. //  focal_point <VECTOR>       // x,y,z point that is in focus
  88. }
  89. @com.------------------------------
  90. @mt2.Ambient fog
  91. fog
  92. {
  93.   fog_type 1
  94.   distance 100
  95.   color SkyBlue
  96. }
  97. @mt2.Ground fog
  98. fog
  99. {
  100.   fog_type   1
  101.   distance   10
  102.   color      Gray
  103.   fog_offset 0.1
  104.   fog_alt    0.2
  105.   turbulence 0.8
  106. }
  107. @mt2.Fog definition
  108. //FIXME
  109. // set global atmospheric fog effect in the scene.
  110. // at the fog distance, there will be 63% visibility
  111.   fog {
  112.     fog_type 1 // 1=constant, 2=ground_fog
  113.     distance 10
  114.     color Gray
  115. // turbulence <TURBULENCE>
  116. // turb_depth TURB_DEPTH
  117. // omega OMEGA
  118. // lambda LAMBDA
  119. // octaves OCTAVES
  120. // fog_offset FOG_OFFSET
  121. // fog_alt FOG_ALT
  122.   }
  123. @com.------------------------------
  124. @mt2.Rainbow
  125. //FIXME
  126.   rainbow {
  127.     direction <DIR>
  128.     angle ANGLE
  129.     width WIDTH
  130.     distance DISTANCE
  131.     color_map { COLOUR_MAP }
  132.     [ jitter JITTER ]
  133.     [ up <UP> ]
  134.     [ arc_angle ARC_ANGLE ]
  135.     [ falloff_angle FALLOFF_ANGLE ]
  136.   }
  137. @com.------------------------------
  138. @mt2.Sky Sphere
  139. // Create an infinite sphere around scene and allow any texture on it
  140. sky_sphere
  141. {
  142.   pigment
  143.   {
  144.     gradient y
  145.     color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
  146.   }
  147. }
  148. @com.------------------------------
  149. @mt2.adc
  150. global_settings { adc_bailout 20 }
  151. @com.------------------------------
  152. @mt2.assumed gamma
  153. global_settings { assumed_gamma 1.0 }
  154. @com.------------------------------
  155. @mt2.HFGray16
  156. global_settings { HF_Gray_16 }
  157. @com.------------------------------
  158. @mt2.irid_wavelength
  159. global_settings { irid_wavelength <0.25, 0.18, 14> }
  160. @com.------------------------------
  161. @mt2.max_trace_level
  162. global_settings { max_trace_level 20 }
  163. @com.------------------------------
  164. @mt2.max_intersections
  165. global_settings { max_intersections 200 }
  166. @com.------------------------------
  167. @mt2.number_of_waves
  168. global_settings { number_of_waves 10 }
  169. @com.------------------------------
  170. @mt2.ambient light
  171. global_settings { ambient_light { color <COLOR> } }
  172. @com.------------------------------
  173. @mt2.max_intersections
  174. // set the maximum ray tracing intersection depth (1...200) [64]
  175. #max_intersections 64
  176. @com.------------------------------
  177. @mt2.max_trace_level
  178. // set the maximum ray tracing bounce depth (1...20) [5]
  179. #max_trace_level 5
  180. @com.------------------------------
  181. @mt2.version
  182. // Set the language version of POV-Ray.  Enables or
  183. // disables syntax features that are version-dependent.
  184. // e.g. #version 1.0, or #version 2.0, etc.
  185. // (Note: This can toggle versions anywhere in the source)
  186. #version 2.0  // use POV-Ray 2.0 syntax
  187. @com.
  188. @com.============================================================
  189. @mt1.Animation
  190. @com.============================================================
  191. @com.
  192. @com.------------------------------
  193. @mt2.clock
  194. // FIXME-fill in an example with clock
  195. @com.
  196. @com.============================================================
  197. @mt1.Expressions
  198. @com.============================================================
  199. @com.
  200. @com.------------------------------
  201. @mt2.Built-in Ids
  202. // These identifiers are built in to POV-Ray, ready to use
  203. //  #declare pi = 3.1415926535897932384626
  204. //  #declare true = 1
  205. //  #declare yes = 1
  206. //  #declare on = 1
  207. //  #declare false = 0
  208. //  #declare no = 0
  209. //  #declare off = 0
  210. //  #declare u = <1,0>
  211. //  #declare v = <0,1>
  212. //  #declare x = <1,0,0>
  213. //  #declare y = <0,1,0>
  214. //  #declare z = <0,0,1>
  215. //  #declare t = <0,0,0,1>
  216. @com.------------------------------
  217. @mt2.Math Operators
  218. //   ()   * /   + -   !
  219. #declare MyResult = -2*B + (A*A - 4)
  220. @mt2.Relational Operators
  221. // Relationals must be within parentheses
  222. // Return arithmetic value 0 for false or 1 for true
  223. //   <  <=  =  !=  >=  >
  224. #declare BallColor = pigment { red (clock > 0.5) } // black or red
  225. @com.------------------------------
  226. @mt2.Vector components
  227. // extract each component of a vector:
  228. // #if (MyVector.x > 5) ...
  229. // #if (MyVector.y > 5) ...
  230. // #if (MyVector.z > 5) ...
  231. // #if (MyVector.t > 5) ...
  232. @com.------------------------------
  233. @mt2.Strings
  234. /* various string operations
  235. asc(S1) // Convert 1st character of S1 to ASCII value
  236. chr(A) // Convert extended ASCII value A to a 1 character string
  237. concat(S1,S2) // combine S1 and S2 into one long string
  238. file_exists(S1): Search current and include directories for existence of file S1 (0 or 1)
  239. str(A,L,P) // Convert float A to string, at least L characters long,
  240.            // with P digits after the decimal point (if P is -1, make max)
  241. strcmp(S1,S2) // compare S1 to S2, return -1, 0, or +1 if S2 is <, =, > than S1
  242. strlen(S1) // Returns # of characters in string S1
  243. strlwr(S1) // Lower case of S1
  244. substr(S1,P,L) // Sub-string from S1, start at position P for length L
  245. strupr(S1) // Upper case of S1
  246. val(S1) // Convert string S1 to float
  247. // some special control characters that can be used within strings
  248.   "\a" Bell or alarm, 0x07
  249.   "\b" Backspace, 0x08
  250.   "\f" Form feed, 0x0C
  251.   "\n" New line (line feed) 0x0A
  252.   "\r" Carriage return 0x0D
  253.   "\t" Horizontal tab 0x09
  254.   "\v" Vertical tab 0x0B
  255.   "\0" Null 0x00
  256.   "\\" Backslash 0x5C
  257.   "\'" Single quote 0x27
  258. */
  259. @com.
  260. @com.============================================================
  261. @mt1.Light sources
  262. @com.============================================================
  263. @com.
  264. @com.------------------------------
  265. @mt2.Point light
  266. // create a regular point light source
  267. light_source
  268. {
  269.   0*x // light's position (translated below)
  270.   color red 1.0  green 1.0  blue 1.0  // light's color
  271.   translate <-20, 40, -20>
  272. }
  273. @com.------------------------------
  274. @mt2.Spotlight
  275. // create a point "spotlight" (conical directed) light source
  276. light_source
  277. {
  278.   0*x                     // light's position (translated below)
  279.   color rgb <1,1,1>       // light's color
  280.   spotlight               // this kind of light source
  281.   translate <40, 80, -40> // <x y z> position of light
  282.   point_at <0, 0, 0>      // direction of spotlight
  283.   radius 5                // hotspot (inner, in degrees)
  284.   tightness 50            // tightness of falloff (1...100) lower is softer, higher is tighter
  285.   falloff 8               // intensity falloff radius (outer, in degrees)
  286. }
  287. @com.------------------------------
  288. @mt2.Cylindrical light
  289. // create a point "spotlight" (cylindrical directed) light source
  290. light_source
  291. {
  292.   0*x                     // light's position (translated below)
  293.   color rgb <1,1,1>       // light's color
  294.   spotlight               // this kind of light source
  295.   cylinder                // this variation
  296.   translate <40, 80, -40> // <x y z> position of light
  297.   point_at <0, 0, 0>      // direction of spotlight
  298.   radius 5                // hotspot (inner, in degrees)
  299.   tightness 50            // tightness of falloff (1...100) lower is softer, higher is tighter
  300.   falloff 8               // intensity falloff radius (outer, in degrees)
  301. }
  302. @com.------------------------------
  303. @mt2.looks_like
  304. // light_source { ...
  305.   // put this inside a light_source to give it a visible appearance
  306.   looks_like { sphere { 0*x, 5 pigment { Yellow } } }
  307. @com.------------------------------
  308. @mt2.area light
  309. // An area light (creates soft shadows)
  310. // WARNING: This special light can significantly slow down rendering times!
  311. light_source
  312. {
  313.   0*x // light's position (translated below)
  314.   color rgb 1.0  // light's color
  315.   // <widthVector> <heightVector> nLightsWide mLightsHigh
  316.   area_light
  317.   <8, 0, 0> <0, 0, 8> // lights spread out across this distance (x * z)
  318.   4, 4                // total number of lights in grid (4x*4z = 16 lights)
  319.   adaptive 0          // 0,1,2,3... 
  320.   jitter              // adds random softening of light
  321.   translate <40, 80, -40>   // <x y z> position of light
  322. }
  323. @com.------------------------------
  324. @mt2.light definition
  325. /*
  326. light_source
  327. {
  328.     <CENTER>
  329.     color <COLOUR>
  330.     [ spotlight ]
  331.     [ cylinder ]
  332.     [ point_at <POINT> ]
  333.     [ radius RADIUS ]
  334.     [ falloff FALLOFF ]
  335.     [ tightness TIGHTNESS ]
  336.     [ area_light <AXIS1>, <AXIS2>, SIZE1, SIZE2 ]
  337.     [ adaptive ADAPTIVE ]
  338.     [ jitter JITTER ]
  339.     [ looks_like { OBJECT } ]
  340.     [ fade_distance FADE_DISTANCE ]
  341.     [ fade_power FADE_POWER (1...2) ]
  342.     [ atmospheric_attenuation BOOL ]
  343.     [ shadowless ]
  344. }
  345. */
  346. @com.
  347. @com.============================================================
  348. @mt1.Misc. Directives
  349. @com.============================================================
  350. @com.
  351. @com.------------------------------
  352. @mt2.atmosphere
  353. //FIXME
  354. /*
  355.   #declare ISOTROPIC_SCATTERING         = 1
  356.   #declare MIE_HAZY_SCATTERING          = 2
  357.   #declare MIE_MURKY_SCATTERING         = 3
  358.   #declare RAYLEIGH_SCATTERING          = 4
  359.   #declare HENYEY_GREENSTEIN_SCATTERING = 5
  360.   atmosphere {
  361.     type SCATTERING_TYPE
  362.     distance DISTANCE
  363.     [ scattering SCATTERING ]
  364.     [ eccentricity ECCENTRICITY ]
  365.     [ samples SAMPLES ]
  366.     [ jitter JITTER ]
  367.     [ aa_threshold AA_THRESHOLD ]
  368.     [ aa_level AA_LEVEL ]
  369.     [ color <COLOUR> ]
  370.   }
  371. */
  372. // Atmosphere with Mie scattering, murky atmosphere (dependent on incident light). 
  373. atmosphere
  374. {
  375.   type 3            // Mie scattering
  376.   samples 20        // Number of samples in first distance interval
  377.   distance 20       // Atmosphere density, similar to fog
  378.   scattering 1.5    // Reflectivity of atmosphere, determines brightness
  379.   aa_level 8        // Level of binary subdivision in case of aa
  380.   aa_threshold 0.1  // Threshold for aa to push in
  381.   jitter 0.2        // Amount of sample jittering
  382. }
  383. @com.------------------------------
  384. @mt2.declare
  385. #declare MyColor = color red 0.7 green 0.5 blue 0.3
  386. @com.------------------------------
  387. @mt2.default
  388. // sets the default texture that objects get when they have no texture specified
  389. #default
  390. {
  391.   texture { pigment {color red 1} finish{ambient 0.2} }
  392. }
  393. @com.------------------------------
  394. @mt2.if
  395. #if (expr)
  396.  
  397. #else
  398.  
  399. #end
  400. @com.------------------------------
  401. @mt2.if example
  402.   #if (High_Quality)
  403.     // This section is parsed if High_Quality is true
  404.   #end // End of conditional part
  405. // or you can use the else clause too
  406.   #if (clock > 2)
  407.     // This section is parsed if clock is > 2
  408.   #else
  409.     // This section is parsed if clock is <= 2
  410.   #end // End of conditional part
  411. @com.------------------------------
  412. @mt2.ifdef
  413. #ifdef (ident)
  414.  
  415. #else
  416.  
  417. #end
  418. @com.------------------------------
  419. @mt2.ifdef example
  420.   #ifdef (SphereFlake_Shape)
  421.     // This section is  parsed if SphereFlake_Shape is declared
  422.   #else
  423.     // This section is  parsed if SphereFlake_Shape is NOT declared
  424.     #declare SphereFlake_Shape = sphere {0,1} // make a default shape
  425.   #end // End of conditional part
  426. @com.------------------------------
  427. @mt2.switch
  428. #switch (expr)
  429.   #case (expr)
  430.   #break
  431.   #case (expr,expr)
  432.   #break
  433.   #else
  434. #end
  435. @com.------------------------------
  436. @mt2.switch example
  437. // Let's make some constant names
  438. #declare CS_Easy   = 1
  439. #declare CS_Medium = 3
  440. #declare CS_Hard   = 5
  441.  
  442. // Let the user choose the method to use
  443. #declare Complexity_Switch = CS_Medium // or CS_Easy or CS_Hard
  444.  
  445. // Do something dependent on the user's choice
  446. #switch (Complexity_Switch)
  447.   #case (CS_Easy)
  448.   // This statement is done if (Complexity_Switch = CS_Easy)
  449.   #declare MyShape = box{-1,+1}
  450.   #break // end of CS_Easy
  451.   #case (CS_Medium, CS_Hard)
  452.   // This statement is done if Complexity_Switch is CS_Medium
  453.   // or CS_Hard or anything in between
  454.   #declare MyShape = torus{1, 0.5}
  455.   #break // end of CS_Hard
  456.   #else
  457.   // This statement is done if none of the above match
  458.   #declare MyShape = sphere{0,1}
  459. #end
  460. @com.------------------------------
  461. @mt2.while
  462. // Create 10 balls along X axis, from 0 to 9
  463. #declare BallCount = 0
  464. #while (BallCount < 10)
  465.   sphere
  466.   {
  467.     <BallCount,0,0>,  // NOTE: <0,0,0>, <1,0,0>, <2,0,0>, etc.
  468.     0.5
  469.   }
  470.   #declare BallCount = BallCount+1 // increment our counter
  471. #end
  472. @com.------------------------------
  473. @mt2.Messages
  474.   #debug      "During scene parsing, general info message"
  475.   #fatal      "During scene parsing, display and force POV-Ray to stop"
  476.   #render     "After scene parsing, about to render"
  477.   #statistics "After scene frame is rendered"
  478.   #warning    "During scene parsing"
  479. #end
  480. @com.------------------------------
  481. @mt2.version
  482. #declare Temp_Vers = version    // Save original value of #version
  483. #version 2.0                    // Change to 1.0 mode
  484. // Version 2.0 stuff goes here ...
  485. #version Temp_Vers              // Restore original #version value
  486. @com.
  487. @com.============================================================
  488. @mt1.Shapes
  489. @com.============================================================
  490. @com.
  491. @com.------------------------------
  492. @mt2.bicubic_patch
  493. // 3D curved FINITE (no CSG) surface created from a mesh of triangles
  494. bicubic_patch
  495. {
  496.   type 1 // patch_type (0..1)
  497.   // 0 = Bezier patch, just store the triangular vertices
  498.   // 1 = Bezier patch, store all plane equations defined by
  499.   //       the triangulation of the patch into sub patches
  500.   //       (faster, uses more memory)
  501.    flatness 0.1 // flatness value
  502.   //       flatness_value = 0.0 to 1.0, with higher values
  503.   //        giving flatter, less smooth results
  504.   u_steps 3 // # of triangles to subdivide (1-5)
  505.   v_steps 3 // # of triangles to subdivide (1-5)
  506.   <0, 0, 2> <1, 0, 0> <2, 0, 0> <3, 0, -2>
  507.   <0, 1, 0> <1, 1, 0> <2, 1, 0> <3, 1,  0>
  508.   <0, 2, 0> <1, 2, 0> <2, 2, 0> <3, 2,  0>
  509.   <0, 3, 2> <1, 3, 0> <2, 3, 0> <3, 3, -2>
  510. }
  511. @com.------------------------------
  512. @mt2.box
  513. // create a box that extends between the 2 specified points
  514. box
  515. {
  516.   <-1, -1, -1>  // one corner position <X1 Y1 Z1>
  517.   < 1,  1,  1>  // other corner position <X2 Y2 Z2>
  518. }
  519. @com.------------------------------
  520. @mt2.blob
  521. // create a smooth blobby shape
  522. #declare StrengthVal = 1.0 // (+ or -) strength of component's radiating density
  523. #declare RadiusVal   = 1.0 // (0 < RadiusVal) outer sphere of influence on other components
  524. blob
  525. {
  526.   // threshold (0.0 < threshold <= StrengthVal) surface falloff threshold #
  527.   threshold 0.6
  528.   sphere { < 0.75,   0,    0>, StrengthVal, RadiusVal }
  529.   sphere { <-0.375,  0.65, 0>, StrengthVal, RadiusVal }
  530.   sphere { <-0.375, -0.65, 0>, StrengthVal, RadiusVal }
  531.   cylinder { -z, +z, 0.1, StrengthVal, RadiusVal }
  532.   // [sturm]
  533.   scale 2
  534. }
  535. @com.------------------------------
  536. @mt2.cone
  537. // clipped conical shape
  538. // cone { <END1>, RADIUS1, <END2>, RADIUS2 [open] }
  539. // Where <END1> and <END2> are vectors defining the x,y,z
  540. // coordinates of the center of each end of the cone
  541. // and RADIUS1 and RADIUS2 are float values for the radii
  542. // of those ends.  open, if present, cone is hollow, else capped
  543. cone
  544. {
  545.   1*y,  0.0,
  546.   -1*y, 1.0
  547.   // open
  548. }
  549. @com.------------------------------
  550. @mt2.cubic
  551. // create a 3rd order infinite polynomial surface
  552. cubic
  553. {
  554.   <
  555. // x^3,      x^2y,     x^2z,     x^2,
  556.    0,        0,        0,        0,
  557. // xy^2,     xyz,      xy,       xz^2,
  558.    0,        0,        0,        0,
  559. // xz,       x,        y^3,      y^2z,
  560.    0,        0,        0,        0,
  561. // y^2,      yz^2,     yz,       y,
  562.    0,        0,        0,        0,
  563. // z^3,      z^2,      z,        C
  564.    0,        0,        0,        0
  565.   >
  566.   sturm // optional, slower but reduces speckles
  567. }
  568.  
  569. @mt2.cylinder
  570. // Capped Cylinder, closed [or open ended]
  571. // cylinder { <END1>, <END2>, RADIUS [open] }
  572. //  END1 = coord of one end of cylinder
  573. //  END2 = coord of other end
  574. // RADIUS = size of cylinder
  575. // open = if present, cylinder is hollow, else capped
  576. cylinder
  577. {
  578.   0*x,  3*x,  1
  579.   // open
  580. }
  581. @com.------------------------------
  582. @mt2.disc
  583. // flat circular FINITE (no CSG) shape, center hole cutout is optional
  584. disc
  585. {
  586.   <0, 1, 0>  // center position
  587.   z,         // normal vector
  588.   1.0,       // outer radius
  589.   0.2        // optional hole radius
  590. }
  591. @com.------------------------------
  592. @mt2.fractal
  593. // create a 3-D slice of a 4-D julia fractal object
  594. julia_fractal
  595.   <-0.083,0.0,-0.83,-0.025> 
  596.   quaternion // hypercomplex?
  597.   cube // TYPE: sqr cube 
  598.   max_iteration 8 
  599.   precision 20 // 10...500? FIXME
  600.   //  slice xx?
  601.  }
  602. @com.------------------------------
  603. @mt2.height_field
  604. // uses image color index as height, extends along X-Z axes
  605. // from <0 0 0> to <1 1 1>
  606. height_field
  607. {
  608.   gif               // the file type to read (gif/tga/pot/pgm/ppm/png/sys)
  609.   "plasma3.gif"     // the file name to read
  610. //  inverse | texture {...}
  611. //  [smooth]        // make smoother surface
  612. //  [water_level N] // truncate/clip below N (0.0 ... 1.0)
  613. // translate VECTOR | rotate VECTOR | scale VECTOR
  614. }
  615. @com.------------------------------
  616. @mt2.height_field+imagemap
  617. // uses image color index as height, extends along X-Z axes
  618. // from <0 0 0> to <1 1 1>
  619. height_field
  620. {
  621.   gif "plasma3.gif"
  622.   texture
  623.   {
  624.     pigment
  625.     {
  626.       image_map { gif "plasma3.gif" map_type 0 interpolate 2 once }
  627.       rotate x*90 // lay X-Y image map down onto X-Z height field plane
  628.     }
  629.   }
  630. }
  631. @com.------------------------------
  632. @mt2.lathe
  633. // rotate a 2-D outline of points around the Y axis to create a 3-D shape
  634. lathe {
  635.   linear_spline // linear_spline | quadratic_spline | cubic_spline
  636.   5, // number of points
  637.   <2, 0>, <3, 0>, <3, 5>, <2, 5>, <2, 0> // the list of <u,v> points
  638. }
  639. @com.------------------------------
  640. @mt2.mesh
  641. // triangle or smooth-triangle mesh FINITE (no CSG) shape
  642. // NOTE: Each triangle can be independently textured,
  643. //       remaining triangles get texture at bottom
  644. mesh // box example here
  645. {
  646.   /* top side */
  647.   triangle { <-2, 2, -2>, <2, 2, -2>, <2, 2, 2> texture { Red } }
  648.   triangle { <-2, 2, -2>, <-2, 2, 2>, <2, 2, 2> texture { Red } }
  649.   /* bottom side */
  650.   triangle { <-2, -2, -2>, <2, -2, -2>, <2, -2, 2> }
  651.   triangle { <-2, -2, -2>, <-2, -2, 2>, <2, -2, 2> }
  652.   /* left side */
  653.   triangle { <-2, -2, -2>, <-2, -2, 2>, <-2, 2, 2> }
  654.   triangle { <-2, -2, -2>, <-2, 2, -2>, <-2, 2, 2> }
  655.   /* right side */
  656.   triangle { <2, -2, -2>, <2, -2, 2>, <2, 2, 2> texture { Green } }
  657.   triangle { <2, -2, -2>, <2, 2, -2>, <2, 2, 2> texture { Green } }
  658.   /* front side */
  659.   triangle { <-2, -2, -2>, <2, -2, -2>, <-2, 2, -2> texture { Blue } }
  660.   triangle { <-2, 2, -2>, <2, 2, -2>, <2, -2, -2> texture { Blue } }
  661.   /* back side */
  662.   triangle { <-2, -2, 2>, <2, -2, 2>, <-2, 2, 2> }
  663.   triangle { <-2, 2, 2>, <2, 2, 2>, <2, -2, 2> }
  664.   texture
  665.   { // remaining triangles get this texture
  666.     pigment { color rgb<0.9, 0.9, 0.9> }
  667.     finish { ambient 0.2 diffuse 0.7 }
  668.   }
  669. }
  670. @com.------------------------------
  671. @mt2.object
  672. // general purpose enclosing wrapper for a predefined shape
  673. #define MyShape = box {-1,1}     // define the shape
  674. object { MyShape }               // create an actual object with that shape
  675. object { MyShape translate 3*x}  // create another object with that shape
  676. @com.------------------------------
  677. @mt2.plane
  678. // An infinite planar surface
  679. // plane {<A, B, C>, D } where: A*x + B*y + C*z = D
  680. plane
  681. {
  682.   y, // <X Y Z> unit surface normal, vector points "away from surface"
  683.   -1.0 // distance from the origin in the direction of the surface normal
  684. }
  685. @com.------------------------------
  686. @mt2.polygon
  687. // arbitrary X,Y FINITE (no CSG) shape
  688. // A complex example for a polygon is the letter "P":
  689. polygon
  690. {
  691.   12, // number of points
  692.   <0, 0>, <0, 6>, <4, 6>, <4, 3>, <1, 3>, <1, 0>, <0, 0>, // list of <u,v> points
  693.   <1, 4>, <1, 5>, <3, 5>, <3, 4>, <1, 4>
  694. }
  695. @com.------------------------------
  696. @mt2.polynomial
  697. // create an Nth order infinite polynomial surface
  698. // poly { N <a,b,c...> [sturm] }
  699. // N = order of poly, M terms where M = (N+1)*(N+2)*(N+3)/6
  700. poly
  701. {
  702.   5, // order of polynomial (2...7)
  703.   <
  704. // x^5,        x^4y,       x^4z,       x^4,
  705.    0,          0,          0,          0,
  706. // x^3y^2,     x^3yz,      x^3y,       x^3z^2,
  707.    0,          0,          0,          0,
  708. // x^3z,       x^3,        x^2y^3,     x^2y^2z,
  709.    0,          0,          0,          0,
  710. // x^2y^2,     x^2yz^2,    x^2yz,      x^2y,
  711.    0,          0,          0,          0,
  712. // x^2z^3,     x^2z^2,     x^2z,       x^2,
  713.    0,          0,          0,          0,
  714. // xy^4,       xy^3z,      xy^3,       xy^2z^2,
  715.    0,          0,          0,          0,
  716. // xy^2z,      xy^2,       xyz^3,      xyz^2,
  717.    0,          0,          0,          0,
  718. // xyz,        xy,         xz^4,       xz^3,
  719.    0,          0,          0,          0,
  720. // xz^2,       xz,         x,          y^5,
  721.    0,          0,          0,          0,
  722. // y^4z,       y^4,        y^3z^2,     y^3z,
  723.    0,          0,          0,          0,
  724. // y^3,        y^2z^3,     y^2z^2,     y^2z,
  725.    0,          0,          0,          0,
  726. // y^2,        yz^4,       yz^3,       yz^2,
  727.    0,          0,          0,          0,
  728. // yz,         y,          z^5,        z^4,
  729.    0,          0,          0,          0,
  730. // z^3,        z^2,        z,          C           
  731.    0,          0,          0,          0
  732.   >
  733.   sturm // optional, slower but reduces speckles
  734. }
  735. @com.------------------------------
  736. @mt2.prism
  737. // extrude a closed 2-D shape along an axis
  738. prism {
  739.   linear_sweep // or conic_sweep for tapering to a point
  740.   cubic_spline // linear_spline | quadratic_spline | cubic_spline
  741.   -0.5,        // height 1
  742.    0.5,        // height 2
  743.   10,          // number of points
  744.   // the <u,v> points
  745.   < 0.2, -1.0>, < 0.2,  0.2>, < 1.0, -0.2>, < 1.0,  0.2>, < 0.2,  1.0>, 
  746.   <-0.2,  1.0>, <-1.0,  0.2>, <-1.0, -0.2>, <-0.2,  0.2>, <-0.2, -1.0>
  747.   // [open]
  748.   // [sturm]
  749. }
  750. @com.------------------------------
  751. @mt2.quadric
  752. // create a quadratic (2nd order) infinite polynomial surface
  753. quadric
  754. {
  755.   <0, 1, 1> //  A x^2  + B y^2  + C z^2  +
  756.   <1, 0, 0> //  D xy   + E xz   + F yz   +
  757.   <0, 3, 0> //  G x    + H y    + I z    +
  758.   2         //  J
  759.   sturm // optional, slower but reduces speckles
  760. }
  761. @com.------------------------------
  762. @mt2.quartic
  763. // create a 4th order infinite polynomial surface
  764. quartic
  765.  {
  766. <
  767. // x^4,        x^3y,       x^3z,       x^3,        x^2y^2,
  768.    0,          0,          0,          0,          0,
  769. // x^2yz,      x^2y,       x^2z^2,     x^2z,       x^2,
  770.    0,          0,          0,          0,          0,
  771. // xy^3,       xy^2z,      xy^2,       xyz^2,      xyz,
  772.    0,          0,          0,          0,          0,
  773. // xy,         xz^3,       xz^2,       xz,         x,
  774.    0,          0,          0,          0,          0,
  775. // y^4,        y^3z,       y^3,        y^2z^2,     y^2z,
  776.    0,          0,          0,          0,          0,
  777. // y^2,        yz^3,       yz^2,       yz,         y,
  778.    0,          0,          0,          0,          0,
  779. // z^4,        z^3,        z^2,        z,          C           
  780.    0,          0,          0,          0,          0
  781. >
  782.   sturm // optional, slower but reduces speckles
  783. }
  784. @com.------------------------------
  785. @mt2.smooth_triangle
  786. // rounded-surface FINITE (no CSG) triangle shape
  787. smooth_triangle
  788. {
  789.   <  0,  30, 0> <0,  0.7071, -0.7071>  // <Vertex1>  <SurfaceNormal1>
  790.   < 40, -20, 0> <0, -0.8664, -0.5>     // <Vertex2>  <SurfaceNormal2>
  791.   <  0,   0, 0> <0, -0.5,    -0.8664>  // <Vertex3>  <SurfaceNormal3>
  792. }
  793. @com.------------------------------
  794. @mt2.sphere
  795. // create a sphere shape
  796. sphere
  797. {
  798.   <0, 1, 0> // center of sphere <X Y Z>
  799.   0.5       // radius of sphere
  800.   // scale <1,2,1> // <= Note: Spheres can become ellipses by uneven scaling
  801. }
  802. @com.------------------------------
  803. @mt2.superellispoid
  804. // create a superquadric ellipsoid shape
  805. // As the exponents approach 1.0, the edges get rounder
  806. superellipsoid
  807. {
  808.   0.5,  // east-west exponent (0.0 ... 1.0)
  809.   1.0,  // north-south exponent (0.0 ... 1.0)
  810. }
  811. @com.------------------------------
  812. @mt2.Surface of Revolution
  813. // create a Surface of Revolution shape (like lathe, but faster)
  814. surface_of_revolution
  815. {
  816.     7, // # of points
  817.     <0.000000, 0.000000> // list of <u,v> points
  818.     <0.118143, 0.000000>
  819.     <0.620253, 0.540084>
  820.     <0.210970, 0.827004>
  821.     <0.194093, 0.962025>
  822.     <0.286920, 1.000000>
  823.     <0.468354, 1.033755>
  824.     // [open]
  825. }
  826. @com.------------------------------
  827. @mt2.text
  828. // create a TrueType text shape
  829. text
  830. {
  831.   ttf             // font type (only TrueType format for now)
  832.   "crystal.ttf",  // Microsoft Windows-format TrueType font file name
  833.   "POV-Ray",      // the string to create
  834.   2,              // the extrusion depth
  835.   0               // inter-character spacing
  836. }
  837. @com.------------------------------
  838. @mt2.torus
  839. // torus {MAJOR, MINOR} // (in the X-Z plane)
  840. // MAJOR = float value giving the major radius
  841. // MINOR = float specifying the minor radius
  842. // The major radius extends from the center of the hole
  843. // to the mid-line of the rim while the minor radius
  844. // is the radius of the cross-section of the rim.
  845. torus
  846. {
  847.   0.8,
  848.   0.2
  849. }
  850. @com.------------------------------
  851. @mt2.triangle
  852. // triangular FINITE (no CSG) shape (vertices are endpoints)
  853. triangle
  854. {
  855.   <-1,  0, -1>  // <Vertex1>
  856.   < 1,  0, -1>  // <Vertex2>
  857.   < 0,  0,  1>  // <Vertex3>
  858. }
  859. @com.
  860. @com.============================================================
  861. @mt1.Shape modifiers
  862. @com.============================================================
  863. @com.
  864. @com.------------------------------
  865. @mt2.bounded_by
  866. // set an outer proposed boundary for parent object(s)
  867. // allows the ray-tracer to do a quick check on the Bounding Shape,
  868. // and if outside, it skips checking this object, which can speed
  869. // up overall rendering of complex shapes.  Note that this
  870. // is not a 100% guaranteed clipping shape... use the
  871. // clipped_by statement for that.
  872. bounded_by { box { -(x+y+z) +(x+y+z) }
  873. @com.------------------------------
  874. @mt2.clipped_by
  875. // set clipping shape for parent object.
  876. // (parent shape will not extend beyond ClipShape bounds)
  877. clipped_by { sphere { 0*x, 1.0 } }
  878. @com.------------------------------
  879. @mt2.hollow
  880. // allow atmosphere inside shape
  881.   hollow
  882. @com.------------------------------
  883. @mt2.no_shadow
  884. // give object no shadow
  885.   no_shadow
  886. @com.------------------------------
  887. @mt2.open
  888. // some objects (cylinder, cone, prism, etc.) can have their ends open
  889.   open
  890. @com.
  891. @com.============================================================
  892. @mt1.CSG operations
  893. @com.============================================================
  894. @com.
  895. @com.------------------------------
  896. @mt2.difference
  897. // CSG difference, subtract intersections of shapes 2...N from Shape1
  898. difference
  899. {
  900.   Shape1 {...} // Start with this shape
  901.   Shape2 {...} // This will be "cut out" of Shape1
  902.   ShapeN {...} // This will be "cut out" of Shape1
  903. }
  904. @com.------------------------------
  905. @mt2.intersection
  906. // CSG intersection, the common space where all the shapes meet
  907. intersection
  908. {
  909.   Shape1 {...}
  910.   Shape2 {...}
  911.   ShapeN {...}
  912. }
  913. @com.------------------------------
  914. @mt2.inverse
  915. // flip an object's inside and outside for intersect/difference
  916. intersection
  917. {
  918.   Shape1 {...}
  919.   Shape2 {... inverse }
  920. }
  921. @com.------------------------------
  922. @mt2.merge
  923. // CSG merge, merge all of shapes 1...N
  924. // like “union”, but melted together so no overlap seam lines inside
  925. merge
  926. {
  927.   Shape1 {...}
  928.   Shape2 {...}
  929.   ShapeN {...}
  930. }
  931. @com.------------------------------
  932. @mt2.union
  933. // CSG union, add all of shapes 1...N
  934. union
  935. {
  936.   Shape1 {...}
  937.   Shape2 {...}
  938.   ShapeN {...}
  939. }
  940. @com.
  941. @com.============================================================
  942. @mt1.Transformations
  943. @com.============================================================
  944. @com.
  945. @mt2.matrix
  946. // Matrix is an object transformation that does rotation about the Y axis,
  947. // shear along the Y axis, and translation along the Y axis
  948. matrix
  949. <
  950.   0.886, 0.5, 0.5,
  951.   0,     1,   0,
  952.   0.5,   0,  -0.886,
  953.   0,     1.5, 0
  954. >
  955. @com.------------------------------
  956. @mt2.rotate
  957. // rotate shape or texture around <0 0 0>, relative to current orientation
  958. // example: rotate 30*x
  959. rotate <45, 45, 0> // <dX  dY  dZ> (in degrees)
  960. @com.------------------------------
  961. @mt2.scale
  962. // "resize" an object or texture relative to its current size
  963. // example: scale 2.0
  964. scale <1.0,  2.0,  1.0> // <dX dY dZ>
  965. @com.------------------------------
  966. @mt2.translate
  967. // Move object or texture relative to current position
  968. // example: translate -5.0*z
  969. translate <2.0, 4.0, -1.0>  // <dX dY dZ>
  970. @com.------------------------------
  971. @mt2.Transform
  972. // object/texture transformation
  973. // do a predeclared translate/rotate/scale combo
  974. // e.g.:
  975. #declare Leaf_Orientation = transform { scale 4.0 rotate 30*z translate 2*y }
  976. transform Leaf_Orientation // transform an object
  977. @com.
  978. @com.============================================================
  979. @mt1.Textures A-M
  980. @com.============================================================
  981. @com.
  982. @com.------------------------------
  983. @mt2.Texture Definition
  984. /*
  985. texture
  986. {
  987.   TEXTURE_IDENTIFIER
  988.   pigment {
  989.     PIGMENT_IDENTIFIER
  990.     PATTERN_TYPE
  991.     PIGMENT_MODIFIERS
  992.     TRANSFORMATIONS...
  993.   }
  994.   normal {
  995.     NORMAL_IDENTIFIER
  996.     NORMAL_PATTERN_TYPE
  997.     NORMAL_MODIFIERS
  998.     TRANSFORMATIONS...
  999.   }
  1000.   finish {
  1001.     FINISH_IDENTIFIER
  1002.     [ ambient AMBIENT | <AMBIENT> ]
  1003.     [ diffuse DIFFUSE ]
  1004.     [ brilliance BRILLIANCE ]
  1005.     [ phong PHONG ]
  1006.     [ phong_size PHONG_SIZE ]
  1007.     [ specular SPECULAR ]
  1008.     [ roughness ROUGHNESS ]
  1009.     [ metallic [ METALLIC ] ]
  1010.     [ reflection REFLECTION | <REFLECTION> ]
  1011.     [ refraction REFRACTION ]
  1012.     [ ior IOR ]
  1013.     [ caustics CAUSTICS ]
  1014.     [ fade_distance FADE_DISTANCE ]
  1015.     [ fade_power FADE_POWER ]
  1016.     [ irid { thickness THICKNESS turbulence TURBULENCE } ]
  1017.     [ crand CRAND ]
  1018.   }
  1019.   halo {
  1020.     attenuating | emitting | glowing | dust
  1021.     [ constant | linear | cubic | poly ]
  1022.     [ planar_mapping | spherical_mapping | cylindrical_mapping | box_mapping 
  1023.     [ dust_type DUST_TYPE ]
  1024.     [ eccentricity ECCENTRICITY ]
  1025.     [ max_value MAX_VALUE ]
  1026.     [ exponent EXPONENT ]
  1027.     [ samples SAMPLES ]
  1028.     [ aa_level AA_LEVEL ]
  1029.     [ aa_threshold AA_THRESHOLD ]
  1030.     [ jitter JITTER ]
  1031.     [ turbulence <TURBULENCE> ]
  1032.     [ octaves OCTAVES ]
  1033.     [ omega OMEGA ]
  1034.     [ lambda LAMBDA ]
  1035.     [ colour_map COLOUR_MAP ]
  1036.     [ frequency FREQUENCY ]
  1037.     [ phase PHASE ]
  1038.     [ scale <VECTOR> ]
  1039.     [ rotate <VECTOR> ]
  1040.     [ translate <VECTOR> ]
  1041.   }
  1042.   TRANSFORMATIONS
  1043. }
  1044. */
  1045. @com.------------------------------
  1046. @mt2.texture example
  1047. texture
  1048. {
  1049.   pigment
  1050.   {
  1051.     marble // some pattern
  1052.     color_map {[0.1 color red 1] [0.5 color rgb 1]}
  1053.     turbulence 0.5
  1054.     scale <1,3,1>// transformations
  1055.   }
  1056.   // same pattern for normal and pigment adds weathered bumps
  1057.   normal
  1058.   {
  1059.     marble // some pattern
  1060.     turbulence 0.5
  1061.     scale <1,3,1>// transformations
  1062.   }
  1063.   finish
  1064.   {
  1065.     ambient 0.2
  1066.     specular 0.6 // shiny
  1067.   }
  1068. }
  1069. @com.------------------------------
  1070. @mt2.agate pattern
  1071. // texture pigment/normal pattern
  1072.   agate // use an agate-like texture
  1073.   agate_turb 0.3 // can alter turbulence [1.0]
  1074.   // color_map {...} // optional color map
  1075. @com.------------------------------
  1076. @mt2.ambient finish
  1077. // texture finish attribute
  1078. ambient 0.2 // set ambient surface reflection (0...1) [0.1]
  1079. @com.------------------------------
  1080. @mt2.attenuation finish
  1081. // texture finish attribute
  1082.    fade_distance 50
  1083.    fade_power 1 // 1 or 2
  1084. @com.------------------------------
  1085. @mt2.bozo pattern
  1086. // texture pigment/normal pattern
  1087. bozo // use color map to swirl colors
  1088. // turbulence 0.3
  1089. // color_map...
  1090. @com.------------------------------
  1091. @mt2.brick pattern
  1092. // texture pigment/normal pattern
  1093.   pigment
  1094.   {
  1095.     brick color Red, color Gray
  1096.     <2,1,1>   // size of brick
  1097.     0.2       // width of mortar
  1098.   }
  1099. @com.------------------------------
  1100. @mt2.brilliance finish
  1101. // texture finish attribute
  1102.   brilliance 0.5 // tightness of diffuse illumination
  1103. @com.------------------------------
  1104. @mt2.bumps pattern
  1105. // texture pigment/normal pattern
  1106.   bumps 0.3 // bumpy surface (0...1)
  1107. @com.------------------------------
  1108. @mt2.caustics finish
  1109. // texture finish attribute
  1110.    caustics 1 // (0...1)
  1111. @com.------------------------------
  1112. @mt2.checker
  1113. // texture pigment/normal pattern
  1114. // cube checker pattern, alternates color1 and color2
  1115.   checker
  1116.     color red 1 green 1 blue 1
  1117.     color red 0 green 1 blue 0
  1118. @com.------------------------------
  1119. @mt2.color
  1120. // texture pigment attribute
  1121. // RGB values can range from 0.0 (dark) to 1.0 (saturated)
  1122.   color red 0.5 green 0.5 blue 0.5 // filter 0.8
  1123. @com.------------------------------
  1124. @mt2.color_map
  1125. // texture pigment {} attribute
  1126. // create a smooth color gradation map
  1127. color_map
  1128. {
  1129.   //  [ END_VAL color red R green G blue B filter F transmit T]
  1130.   [  0.1  color red 0.0 green 0.0 blue 0.0]
  1131.   [  0.3  color red 0.8 green 0.4 blue 0.2]
  1132.   [  0.5  color red 0.0 green 0.0 blue 0.0]
  1133.   [  0.7  color red 0.0 green 0.0 blue 0.8 filter 0.5]
  1134.   [  1.0  color red 0.8 green 0.8 blue 0.8 filter 1.0]
  1135. } // color_map
  1136. @com.------------------------------
  1137. @mt2.crackle pattern
  1138. // texture pigment/normal pattern
  1139.    crackle 0.5 turbulence 0.5
  1140. @com.------------------------------
  1141. @mt2.crand finish
  1142. // texture finish attribute
  1143. // randomly speckle the surface
  1144.  // Note, this is truly random, and looks BAD in animations
  1145. crand 0.2
  1146. @com.------------------------------
  1147. @mt2.dents pattern
  1148. // texture pigment/normal pattern
  1149. dents 0.6 // dented surface (0...1) [0.0]
  1150. @com.------------------------------
  1151. @mt2.diffuse finish
  1152. // texture finish attribute
  1153. diffuse 0.6 // amount of diffuse lighting (0...1) [0.6]
  1154. @com.------------------------------
  1155. @mt2.finish component
  1156. // texture statement
  1157. finish { ambient 0.2 specular 0.5 reflection 0.2 }
  1158. @com.------------------------------
  1159. @mt2.frequency attribute
  1160. // texture pigment/normal attribute
  1161. frequency 2.0 // oscillation freq. of radial, ripples, waves, etc
  1162. @com.------------------------------
  1163. @mt2.gradient pattern
  1164. // texture pigment/normal pattern
  1165. gradient x+y // specify color_map direction(s)
  1166. // color_map {...} // requires a color map
  1167. @com.------------------------------
  1168. @mt2.granite pattern
  1169. // texture pigment/normal pattern
  1170. granite // create a granite-like texture
  1171. // color_map {...} // optional color map
  1172. @com.------------------------------
  1173. @mt2.halo component
  1174. // texture component
  1175. halo
  1176. {
  1177.   dust
  1178.   dust_type 2
  1179.   constant
  1180.   spherical_mapping
  1181.   max_value 1.0
  1182.   colour_map
  1183.   {
  1184.     [ 0 color rgbf <1, 1, 1, 0.0> ]
  1185.     [ 1 color rgbf <1, 1, 1, 0.1> ]
  1186.   } 
  1187.   samples 100
  1188.   aa_level 5
  1189.   aa_threshold 0.1
  1190.   jitter 0.8
  1191. }  
  1192. @com.------------------------------
  1193. @mt2.hexagon pattern
  1194. // texture pigment/normal pattern
  1195. // create a hexagonal pattern texture with 3 colors
  1196. // hexagons are in the X-Z plane, extending infinitely in Y plane
  1197. hexagon
  1198.   color blue 1
  1199.   color red 1
  1200.   color green 1
  1201. @com.------------------------------
  1202. @mt2.irid finish
  1203. // texture finish attribute
  1204.   irid
  1205.   {
  1206.     0.4            // amount of iridescence saturation (0...1) [0]
  1207.     thickness 0.2
  1208.     turbulence 0.7
  1209.   }
  1210. @com.------------------------------
  1211. @mt2.ior finish
  1212. // texture finish attribute
  1213. // 1.0=air, 1.33=water, 1.5=glass, 2.4=diamond (see also IOR.INC)
  1214. ior 1.3 // index of refraction
  1215. @com.------------------------------
  1216. @mt2.lambda attribute
  1217. // texture pigment/normal attribute
  1218. // change surface perturbation property
  1219. // makes turbulence more "swirly"
  1220. lambda 1.2 // (1.0...5.0) [2.0]
  1221. @com.------------------------------
  1222. @mt2.leopard pattern
  1223. // texture pigment/normal pattern
  1224. leopard // create a leopard spotted texture
  1225. // color_map {...} // optional color map
  1226. @com.------------------------------
  1227. @mt2.mandel pattern
  1228. // texture pigment/normal pattern
  1229. // create a mandelbrot fractal surface in the X-Y plane
  1230. mandel 50 // (2...1000) [256]
  1231. // scale <...> translate <...> // zoom and move
  1232. // color_map {...} // requires a color map
  1233. @com.------------------------------
  1234. @mt2.marble pattern
  1235. // texture pigment/normal pattern
  1236. marble // create a marble-like texture
  1237. // turbulence 1.0 // should have some!
  1238. // color_map {...} // uses a color map
  1239. @com.------------------------------
  1240. @mt2.metallic finish
  1241. // texture finish attribute
  1242. // use surface color, not light source color for phong hilights
  1243. metallic on // on/off
  1244. @com.
  1245. @com.============================================================
  1246. @mt1.Textures N-Z
  1247. @com.============================================================
  1248. @com.
  1249. @com.------------------------------
  1250. @mt2.normal component
  1251. // texture component
  1252.   normal { wrinkles 0.5 scale 0.5 }
  1253. @com.------------------------------
  1254. @mt2.octaves attribute
  1255. // texture pigment/normal attribute
  1256. // increases the "folds" in turbulence changes
  1257. octaves 3 // (1...10) [6]
  1258. @com.------------------------------
  1259. @mt2.omega attribute
  1260. // texture pigment/normal attribute
  1261. // change surface perturbation property
  1262. // makes turbulence more "krinkly"
  1263. omega 1.2 // (0.0...2.0) [0.5]
  1264. @com.------------------------------
  1265. @mt2.onion pattern
  1266. // texture pigment/normal pattern
  1267. onion // create an onion-like concentric circle texture
  1268. // color_map {...} // requires a color map
  1269. @com.------------------------------
  1270. @mt2.phase attribute
  1271. // texture pigment/normal attribute
  1272. // change the phase of ripples, etc.
  1273. // Animation note:  As phase DECREASES, ripples move OUTWARD.
  1274. phase 0.5
  1275. @com.------------------------------
  1276. @mt2.phong finish
  1277. // texture finish attribute
  1278. // add phong hilighting to surface (0...1)
  1279.  phong 0.8
  1280. @com.------------------------------
  1281. @mt2.phong_size finish
  1282. // texture finish attribute
  1283. // set the size of the phong spot (1...250) [40]
  1284. // 20=dull rubber, 40=plastic, 200=shiny glass
  1285. phong_size 80
  1286. @com.------------------------------
  1287. @mt2.quick_color attribute
  1288. // texture pigment attribute
  1289. quick_color green 1 // low-quality quick-render color
  1290. @com.------------------------------
  1291. @mt2.quilted pattern
  1292. // texture pigment/normal pattern
  1293. // creates a pattern like a quilt
  1294. quilted 0.4 // amount
  1295. control0 -1 // lower curvature (-1...1)
  1296. control1 1 // upper curvature (-1...1)
  1297. @com.------------------------------
  1298. @mt2.radial pattern
  1299. // texture pigment/normal pattern
  1300. // radially projected color_map in X-Z
  1301. radial
  1302. // frequency 4.0 // increases # of color "spokes"
  1303. // color_map ...
  1304. @com.------------------------------
  1305. @mt2.reflection finish
  1306. // texture finish attribute
  1307. reflection 0.3 // amount of surface reflection (0...1) [0]
  1308. @com.------------------------------
  1309. @mt2.refraction finish
  1310. // texture finish attribute
  1311. // turn this on (1) if using "filter" in pigment colors
  1312. refraction 1 // amount of pass-through light (0 or 1) [0]
  1313. @com.------------------------------
  1314. @mt2.ripples pattern
  1315. // texture pigment/normal pattern
  1316. ripples 0.5 // make surface ripply (0...1)
  1317. @com.------------------------------
  1318. @mt2.roughness finish
  1319. // texture finish attribute
  1320. // alters specular hilighting
  1321. roughness 0.01 // 1.0=rough, 0.001=smooth [0.05]
  1322. @com.------------------------------
  1323. @mt2.specular finish
  1324. // texture finish attribute
  1325. // Note: size of hilight depends on roughness attribute
  1326. specular 0.7 // use specular hilighting on surface (0...1) [0]
  1327. @com.------------------------------
  1328. @mt2.spiral1 pattern
  1329. // texture pigment/normal pattern
  1330.   spiral1 5
  1331. @com.------------------------------
  1332. @mt2.spiral2 pattern
  1333. // texture pigment/normal pattern
  1334.   spiral2 5, 0.6
  1335. @com.------------------------------
  1336. @mt2.spotted pattern
  1337. // texture pigment/normal pattern
  1338.   spotted // create a spotted texture, turbulence has no effect
  1339. // color_map {...} // requires a color map
  1340. @com.------------------------------
  1341. @mt2.turbulence attribute
  1342. // texture pigment/normal attribute
  1343. // Takes a float or vector, see also octaves, omega, lambda, frequency
  1344. turbulence <0, 1, 0.5> // how much to “stir up” the texture (0...1 or more)
  1345. @com.------------------------------
  1346. @mt2.warp attribute
  1347. // texture pigment modifier
  1348. warp { turbulence 0.4*x octaves 2 repeat x*2  flip y  offset z*0.25 }
  1349. @com.------------------------------
  1350. @mt2.waves pattern
  1351. // texture pigment/normal pattern
  1352. // create a wavy surface (also use phase)
  1353. waves 0.5
  1354. @com.------------------------------
  1355. @mt2.wood pattern
  1356. // texture pigment/normal pattern
  1357. // create a concentric cylindrical wood-like texture,
  1358. // grain along Z axis
  1359. wood
  1360. // turbulence 0.1 // should have some!
  1361. // color_map {...} // optional color map
  1362. @com.------------------------------
  1363. @mt2.wrinkles pattern
  1364. // texture pigment/normal pattern
  1365. // create a wrinkly surface (0...1 or more)
  1366. wrinkles 0.5
  1367. @com.------------------------------
  1368. @com.
  1369. @com.============================================================
  1370. @mt1.Texture Colors
  1371. @com.============================================================
  1372. @com.
  1373. @com.------------------------------
  1374. @mt2.blue
  1375. color blue 1
  1376. @com.------------------------------
  1377. @mt2.filter
  1378. color red 1 filter 1
  1379. @com.------------------------------
  1380. @mt2.green
  1381. color green 1
  1382. @com.------------------------------
  1383. @mt2.red
  1384. color red 1
  1385. @com.------------------------------
  1386. @mt2.transmit
  1387. color green 1 transmit 1
  1388. @com.------------------------------
  1389. @mt2.rgb
  1390. // rgb - Red Green Blue color shortcut
  1391. color rgb <0.2, 0.3, 0.4>
  1392. @com.------------------------------
  1393. @mt2.rgbf
  1394. // rgbf - Red Green Blue Filter color shortcut
  1395. color rgbf <0.2, 0.3, 0.4, 0.9>
  1396. @com.------------------------------
  1397. @mt2.rgbft
  1398. // rgbft - Red Green Blue Filter Transmit color shortcut
  1399. // NOTE: filter + transmit should always equal 1.0
  1400. color rgbft <0.5, 0.5, 0.5, 0.4, 0.6>
  1401. @com.------------------------------
  1402. @mt2.rgbt
  1403. // rgbt - Red Green Blue Transmit color shortcut
  1404. color rgbt <0.2, 0.3, 0.4, 0.9>
  1405. @com.------------------------------
  1406. @mt2.color components
  1407. // extract each component of a color:
  1408. // #if (MyColor.red < 0.5) ...
  1409. // #if (MyColor.green < 0.5) ...
  1410. // #if (MyColor.blue < 0.5) ...
  1411. // #if (MyColor.filter < 0.5) ...
  1412. // #if (MyColor.transmit < 0.5) ...
  1413. @com.
  1414. @com.============================================================
  1415. @mt1.Texture Maps
  1416. @com.============================================================
  1417. @com.
  1418. @com.------------------------------
  1419. @mt2.bump_map normal
  1420. // texture normal {} attribute
  1421. // create a texture that has a bumpiness corresponding to color index
  1422. // image maps into X-Y plane from <0,0,0> to <1,1,0>
  1423. bump_map
  1424. { // uses image color or index as bumpiness
  1425.   gif "plasma3.gif" // the file to read (iff/gif/tga/png/sys)
  1426.   map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
  1427.   interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance
  1428.   // [use_color | use_index]
  1429.   // [once]
  1430.   bump_size 0.5 // 0...3
  1431. } // bump_map
  1432. @com.------------------------------
  1433. @mt2.image_map pigment
  1434. // texture pigment {} attribute
  1435. // create a texture that lays an image's colors onto a surface
  1436. // image maps into X-Y plane from <0,0,0> to <1,1,0>
  1437. image_map
  1438. {
  1439.   gif "plasma3.gif" // the file to read (iff/gif/tga/png/sys)
  1440.   map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
  1441.   interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance
  1442.   // [filter N V] // N=all or color index # (0...N), V= value (0.0...1.0)
  1443.   // [transmit N V] // N=all or color index # (0...N), V= value (0.0...1.0)
  1444.   // [use_color | use_index]
  1445.   // [once]
  1446. } // image_map
  1447. @com.------------------------------
  1448. @mt2.material_map texture
  1449. // texture attribute
  1450. // create a texture that maps different textures onto different color indexes
  1451. // image maps into X-Y plane from <0,0,0> to <1,1,0>
  1452. material_map
  1453. {
  1454.   gif "plasma3.gif" // the file to read (iff/gif/tga/png/sys)
  1455.   map_type 0 // 0=planar, 1=spherical, 2=cylindrical, 5=torus
  1456.   interpolate 2 // 0=none, 1=linear, 2=bilinear, 4=normalized distance
  1457.   // [once]
  1458.   texture { pigment {wood} }  // texture for color index # 0
  1459.   texture { pigment {granite} }  // texture for color index # 1
  1460.   texture { pigment {agate} }  // texture for color index # 2
  1461.   // etc...
  1462. } // material_map
  1463. @com.------------------------------
  1464. @mt2.tiles texture
  1465. // texture component
  1466. // create a tiled texture, alternates between 2 full textures
  1467. tiles
  1468. {
  1469.   texture    // full texture of tile #1
  1470.   {
  1471.     pigment { agate scale 0.3 }
  1472.     finish { ambient 0.2 }
  1473.   }
  1474.   tile2
  1475.   texture    // full texture of tile #2
  1476.   {
  1477.     pigment { granite }
  1478.     finish { specular 0.3 reflection 0.2 }
  1479.   }
  1480. }
  1481. @com.
  1482. @com.============================================================
  1483. @mt1.Std colors
  1484. @com.============================================================
  1485. @com.
  1486. @mt2."Colors.inc"
  1487. // Standard pre-defined colors
  1488. #include "colors.inc"
  1489. @com.
  1490. @com.============================================================
  1491. @mt1.Ready-Made Scenes
  1492. @com.============================================================
  1493. @com.
  1494. @com.------------------------------
  1495. @mt2.Basic scene
  1496. // Persistence of Vision Ray Tracer Scene Description File
  1497. // File: ?.pov
  1498. // Vers: 3
  1499. // Desc: Basic Scene Example
  1500. // Date: mm/dd/yy
  1501. // Auth: ?[esp]
  1502. //
  1503.  
  1504. #version 3
  1505.  
  1506. #include "colors.inc"
  1507.  
  1508. global_settings
  1509. {
  1510.   assumed_gamma 1.0
  1511. }
  1512.  
  1513. // ----------------------------------------
  1514. camera
  1515. {
  1516.   location  <0.0, 0.5, -4.0>
  1517.   direction 1.5*z
  1518.   right     4/3*x
  1519.   look_at   <0.0, 0.0,  0.0>
  1520. }
  1521.  
  1522. sky_sphere
  1523. {
  1524.   pigment
  1525.   {
  1526.     gradient y
  1527.     color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
  1528.   }
  1529. }
  1530.  
  1531. light_source
  1532. {
  1533.   0*x // light's position (translated below)
  1534.   color red 1.0  green 1.0  blue 1.0  // light's color
  1535.   translate <-30, 30, -30>
  1536. }
  1537.  
  1538. // ----------------------------------------
  1539. plane { y, -1 pigment {color rgb <0.7,0.5,0.3>}}
  1540.  
  1541. sphere { 0.0, 1 texture {pigment {radial frequency 8} finish{specular 1}} }
  1542.  
  1543. @com.------------------------------
  1544. @mt2.Checkered floor
  1545. // Persistence of Vision Ray Tracer Scene Description File
  1546. // File: ?.pov
  1547. // Vers: 3
  1548. // Desc: Checkered Floor Example
  1549. // Date: mm/dd/yy
  1550. // Auth: ?
  1551. //
  1552.  
  1553. #version 3
  1554.  
  1555. #include "colors.inc"
  1556.  
  1557. global_settings
  1558. {
  1559.   assumed_gamma 1.0
  1560. }
  1561.  
  1562. // ----------------------------------------
  1563. camera
  1564. {
  1565.   location  <0.0, 0.5, -4.0>
  1566.   direction 1.5*z
  1567.   right     4/3*x
  1568.   look_at   <0.0, 0.0,  0.0>
  1569. }
  1570.  
  1571. sky_sphere
  1572. {
  1573.   pigment
  1574.   {
  1575.     gradient y
  1576.     color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
  1577.   }
  1578. }
  1579.  
  1580. light_source
  1581. {
  1582.   0*x // light's position (translated below)
  1583.   color red 1.0  green 1.0  blue 1.0  // light's color
  1584.   translate <-30, 30, -30>
  1585. }
  1586.  
  1587. // ----------------------------------------
  1588. plane
  1589. {
  1590.   y, -1
  1591.   texture
  1592.   {
  1593.     pigment {checker color rgb 1 color blue 1 scale 0.5}
  1594.     finish {reflection 0.2}
  1595.   }
  1596. }
  1597.  
  1598. sphere { 0.0, 1 texture {pigment {radial frequency 8} finish{specular 1}} }
  1599.  
  1600. @com.------------------------------
  1601. @mt2.Text Fonts
  1602. // Persistence of Vision Ray Tracer Scene Description File
  1603. // File: ?.pov
  1604. // Vers: 3
  1605. // Desc: Basic TTF font Example
  1606. // Date: mm/dd/yy
  1607. // Auth: ?
  1608. //
  1609.  
  1610. #version 3
  1611.  
  1612. global_settings
  1613. {
  1614.   assumed_gamma 1.0
  1615. }
  1616.  
  1617. // ----------------------------------------
  1618. camera
  1619. {
  1620.   location  <0.0, 2.0, -6.0>
  1621.   direction 1.5*z
  1622.   right     4/3*x
  1623.   look_at   <0.0, 0.0,  0.0>
  1624. }
  1625.  
  1626. sky_sphere
  1627. {
  1628.   pigment
  1629.   {
  1630.     gradient y
  1631.     color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
  1632.   }
  1633. }
  1634.  
  1635. light_source
  1636. {
  1637.   0*x // light's position (translated below)
  1638.   color red 1.0  green 1.0  blue 1.0  // light's color
  1639.   translate <-20, 10, -30>
  1640. }
  1641.  
  1642. // ----------------------------------------
  1643.  
  1644. #declare Text_Tex = texture
  1645. {
  1646.   pigment { granite scale 0.5 }
  1647.   finish { specular 0.7 }
  1648. }
  1649.  
  1650. text
  1651. {
  1652.   ttf "crystal.ttf", "Hello",
  1653.   2, // depth
  1654.   0  // spacing
  1655.   texture {Text_Tex}
  1656.   rotate <0, -20, 0>
  1657.   translate <-1, 0, -3>
  1658. }
  1659.  
  1660. text
  1661. {
  1662.   ttf "crystal.ttf", "Virtual World!",
  1663.   1, // depth
  1664.   0  // spacing
  1665.   scale <1, 2, 1> // stretch it taller
  1666.   texture {Text_Tex}
  1667.   rotate <0, -30, 0>
  1668.   translate <-3, 0, 3>
  1669. }
  1670.  
  1671.  
  1672. plane { y, 0 pigment {color rgb <0.7,0.5,0.3>} }
  1673.  
  1674. @com.------------------------------
  1675. @mt2.Image Map
  1676. // Persistence of Vision Ray Tracer Scene Description File
  1677. // File: ?.pov
  1678. // Vers: 3
  1679. // Desc: Image Map Example
  1680. // Date: mm/dd/yy
  1681. // Auth: ?
  1682. //
  1683.  
  1684. #version 3
  1685.  
  1686. #include "colors.inc"
  1687.  
  1688. global_settings
  1689. {
  1690.   assumed_gamma 1.0
  1691. }
  1692.  
  1693. // ----------------------------------------
  1694. camera
  1695. {
  1696.   location  <0.0, 0.0, -4.0>
  1697.   direction 2*z
  1698.   right     4/3*x
  1699.   look_at   <0.0, 0.0,  0.0>
  1700. }
  1701.  
  1702. sky_sphere
  1703. {
  1704.   pigment
  1705.   {
  1706.     gradient y
  1707.     color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
  1708.   }
  1709. }
  1710.  
  1711. light_source
  1712. {
  1713.   0*x // light's position (translated below)
  1714.   color red 1.0  green 1.0  blue 1.0  // light's color
  1715.   translate <-30, 30, -30>
  1716. }
  1717.  
  1718. // ----------------------------------------
  1719. plane
  1720. {
  1721.   y, -1
  1722.   texture
  1723.   {
  1724.     pigment {checker color rgb 1 color blue 1 scale 0.5}
  1725.     finish {reflection 0.2}
  1726.   }
  1727. }
  1728.  
  1729. plane
  1730. {
  1731.   z, -1
  1732.   texture
  1733.   {
  1734.     pigment
  1735.     {
  1736.       image_map
  1737.       {
  1738.         gif "test.gif"
  1739.         interpolate 2 // smooth it
  1740.         once   // don't tile image, just one copy
  1741.         filter 0 0.8  // make 1st color mostly transparent
  1742.         filter 1 0.8  // make 2nd color mostly transparent
  1743.       }
  1744.       // transform it to unit-size (-1 to +1)
  1745.       translate -0.5*(x+y) // center on the origin
  1746.       scale 2              // make it unit-sized
  1747.     }
  1748.     finish {ambient 0.3}
  1749.   }
  1750. }
  1751. @com.============================================================
  1752. @com.end of file is next
  1753. @@@@
  1754.